//
//  BulletSetting.swift
//  SkyApp
//
//  Created by 白翊 on 2021/12/20.
//

import UIKit

var bulletWeight: BulletSettingWeight   = .medium
var bulletSize: BulletSettingSize       = .large
var bulletSpeed: BulletSettingSpeed     = .medium
var bulletDesc: String                  = "掌中弹幕"
var bulletColor: UIColor                = .title
var bulletBGColor: UIColor              = .bg
var bulletShadow: UIColor               = .theme
var bulletStop: Bool                    = false

enum BulletSettingWeight: String {
    case bold        = "较粗"
    case medium      = "中等"
    case light       = "较细"
    case thin        = "特细"
    
    var weight: UIFont.Weight {
        switch self {
        case .bold:
            return .bold
        case .medium:
            return .medium
        case .light:
            return .light
        case .thin:
            return .thin
        }
    }
    
    var shadowBlur: CGFloat {
        switch self {
        case .bold:
            return 24
        case .medium:
            return 16
        case .light:
            return 8
        case .thin:
            return 4
        }
    }
}

enum BulletSettingSize: String {
    case superLarge = "特大"
    case large      = "大"
    case medium     = "中"
    case small      = "小"
    
    var size: CGFloat {
        switch self {
        case .superLarge:
            return 240
        case .large:
            return 160
        case .medium:
            return 120
        case .small:
            return 90
        }
    }
}

enum BulletSettingSpeed: String {
    case fast       = "快速"
    case medium     = "中等"
    case slow       = "较慢"
    
    var speed: CGFloat {
        switch self {
        case .fast:
            return 500.0
        case .medium:
            return 250.0
        case .slow:
            return 100.0
        }
    }
}
